package learn.advance.varargs;

class Demo1VarArgs{
    public static void Test(){

        Method("hello",1,2,3,4);
        int sum=add(1,2);
        System.out.println(sum);
    }

    public static void Method(Object ...arr){

    }

    public static int add(int ...arr){
        int sum=0;
        for(int i:arr){
            sum+=i;
        }
        return sum;
    }
}



public class TestVarArgs {

    public static void main(String[] args) {
        Demo1VarArgs.Test();
    }
}
